package com.zhitan.ems.app.iot.enums;

/**
 * 能源类型枚举
 * @author zhitan
 */
public enum DEVICE_ONLINE_STATUS_ENUM {
	inactive("未激活", 1,"inactive"), 
	disabled("禁用", 2,"disabled"), 
	online("在线", 3,"online"), 
	offline("离线", 4,"offline"),;
	private final String name;
	private final Integer state;
	private final String code;
	DEVICE_ONLINE_STATUS_ENUM(String name, Integer state,String code) {
		this.name = name;
		this.state = state;
		this.code = code;
	}
	public String getName() {
		return name;
	}

	public String getCode() {
		return code;
	}
	public Integer getState() {
		return state;
	}
	public static DEVICE_ONLINE_STATUS_ENUM findByState(int _nCode) {
		for (DEVICE_ONLINE_STATUS_ENUM type : DEVICE_ONLINE_STATUS_ENUM.values()) {
			if (_nCode == type.state) {
				return type;
			}
		}
		return inactive;
	}
	
}
